package com.glsc.ngateway.common.base.domain.mysql.gateway.system;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDateTime;

@Entity
@Data
@Table(name = "t_gw_system_class_config")
@org.hibernate.annotations.Table(appliesTo = "t_gw_system_class_config",comment = "系统分类编号配置表")
public class SystemClassConfig implements Serializable {

    private static final long serialVersionUID = -1653756677491701527L;

    @ApiModelProperty(value = "主键")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", columnDefinition = "int comment '主键'")
    private Integer id;

    @ApiModelProperty(value = "系统大类")
    @Column(name = "main_class", columnDefinition = "varchar(10) comment '系统大类'")
    private String mainClass;

    @ApiModelProperty(value = "系统类别")
    @Column(name = "system_class", columnDefinition = "varchar(10) comment '系统类别'")
    private String systemClass;

    @ApiModelProperty(value = "系统类别名称")
    @Column(name = "sytem_class_name", columnDefinition = "varchar(10) comment '系统类别名称'")
    private String sytemClassName;

    @ApiModelProperty(value = "已经分配序列号")
    @Column(name = "class_no_seq", columnDefinition = "varchar(10) comment '已经分配序列号'")
    private Integer classNoSeq;

//    @ApiModelProperty(value = "该类别已分配最大系统编号")
//    @Column(name = "class_no_max_assign", columnDefinition = "varchar(10) comment '该类别已分配最大系统编号'")
//    private Integer classNoMaxAssign;

    @ApiModelProperty(value = "删除状态")
    @Column(name = "deleted", columnDefinition = "varchar(2) comment '删除状态'")
    private String deleted;

    @ApiModelProperty(value = "操作人员账号")
    @Column(name = "op_operator", columnDefinition = "varchar(20) comment '操作人员账号'")
    private String opOperator;

    @ApiModelProperty(value = "操作人员姓名")
    @Column(name = "op_operator_name", columnDefinition = "varchar(20) comment '操作人员姓名'")
    private String opOperatorName;

    @ApiModelProperty(value = "操作来源")
    @Column(name = "op_source", columnDefinition = "varchar(64) comment '操作来源'")
    private String opSource;

    @Column(name = "op_time", columnDefinition = "datetime comment '操作时间'")
    @org.hibernate.annotations.UpdateTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    protected LocalDateTime opTime;

    @ApiModelProperty(value = "预留分类1")
    @Column(name = "reserve_class_one", columnDefinition = "varchar(2) comment '预留分类1'")
    private String reserveClassOne;

    @ApiModelProperty(value = "预留分类2")
    @Column(name = "reserve_class_two", columnDefinition = "varchar(2) comment '预留分类2'")
    private String reserveClassTwo;

    @ApiModelProperty(value = "预留分类3")
    @Column(name = "reserve_class_three", columnDefinition = "varchar(2) comment '预留分类3'")
    private String reserveClassThree;

    @ApiModelProperty(value = "预留分类4")
    @Column(name = "reserve_class_four", columnDefinition = "varchar(2) comment '预留分类4'")
    private String reserveClassFour;

    /**
     * @see
     */
    @ApiModelProperty(value = "业务类型")
    @Column(name = "business_type", columnDefinition = "varchar(64) comment '业务类型'")
    private String businessType;
}
